
function $(arg) {
    return document.getElementById(arg);
}
function eCheckAll(e) {
    var is_ck, chk;
    if(! e) e = window.event;

    is_ck = $('chkall').checked;

    var chks = document.getElementsByTagName("input");
    for(var i = 0; i < chks.length; i++) {
        chk = chks[i];
        chk.checked = is_ck;
    }
}

// a file has been chosen
function eFileSelect() {
    $('uploading').style.visibility = 'hidden';
    document.upform.upbutton.style.visibility =
        zipfile().value.slice(-4).toLowerCase() == ".zip"
            ? "visible"
            : "hidden";
    if(zipfile().value == "") {
        return;
    }
    if(zipfile().value.slice(-4).toLowerCase() != ".zip") {
        window.alert(".zip?");
        return;
    }
}

function eUpClick() {
    $('uploading').style.visibility = 'visible';
    document.upform.submit();
}

function zipfile() {
    return document.upform.projectzipfile;
}
